import { createRouter, createWebHistory, createWebHashHistory } from 'vue-router'

const routers = [
  {
    path: '/login',
    name: 'login',
    component: () =>
      import('@/views/login/Login.vue')
  },
  {
    path: '/home',
    name: 'Home',
    component: () =>
      import('@/views/home/Home.vue'),
    meta: {
      requiresAuth: true
    },
  },

  {

    path: '/:pathMatch(.*)*',
    name: "notfound",
    // meta: {
    //   requiresAuth: true
    // },
    component: () =>
      import("@/views/NotFound.vue"),
  },

]

// 动态路由
export const DynamicRoutes = [
  {
    path: "/",
    component: () =>
      import("@/views/layout/layout.vue"),
    name: "/",
    // redirect: "home",
    children: [

    ]
  },

]

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: routers
})

export default router
